﻿<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>table</title>
    <style>
        table{
            width: 50%;
            border: 1px solid black;
            margin: 0 auto;
            border-collapse: collapse;
        }
        td{
            border: 1px solid black;
        }
        tr:nth-child(odd){
            background-color: #bfa;
        }
        .box1{
            width: 300px;
            height: 300px;
            background-color: orange;
            /*table-cell必须要*/
            display:table-cell;
            vertical-align:middle;
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color: yellow;
            margin: 0 auto;
        }
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2">
            
        </div>
    </div>
    <table>
        <tr>
            <td>学号</td>
            <td>姓名</td>
            <td>年龄</td>
            <td>地址</td>
        </tr>
        <tr>
            <td>A</td>
            <td>王琨鹏</td>
            <td>22</td>
            <td>上海</td>
        </tr>
        <tr>
            <td>学号</td>
            <td>姓名</td>
            <td>年龄</td>
            <td>地址</td>
        </tr>
        <tr>
            <td>学号</td>
            <td>姓名</td>
            <td>年龄</td>
            <td>地址</td>
        </tr>
    </table>
</body>
</html>